package org.example.netty.mgt;

import io.netty.channel.Channel;
import io.netty.channel.ChannelId;
import org.example.netty.model.ExtendedChannelContext;
import org.example.netty.config.NettyEndpointConfig;

import java.util.List;

/**
 * 用来管理自定义扩展的netty连接的管理类
 */
public interface ConnectionManager {
    /**
     * 生成requestId
     * @return requestId
     */
    long generateRequestId();
    NettyEndpointConfig getNettyConfig();
    void putChannel(Channel channel);
    void removeChannel(Channel channel);
    Channel getChannel(ChannelId channelId);

    ExtendedChannelContext getExtendedChannelContext(ChannelId channelId);
    List<ExtendedChannelContext> getAllExtendedChannelContext();
}
